package com.fc.happyteam.process.migrate.option;

/**
 * non is an option implementation that indicates no value.
 * 
 * @param <T> the type of option
 */
public final class None<T> implements Option<T> {

    /**
     * @see Option#get()
     */
    @Override 
    public T get() {
        throw new UnsupportedOperationException("Cannot resolve value on None");
    }

    /**
     * @see Option#isNone()
     */
    @Override
    public boolean isNone() {
        return true;
    }
    
    /**
     * @see com.cg.rstf.utils.option.Option#hasValue()
     */
    @Override
    public boolean hasValue() {
        return !isNone();
    }

    @Override
    public T getOr(T value) {
        return value;
    }    

}
